<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('新增病历管理')" />
    <th:block th:include="include :: select2-css" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-bl-add">
            <div class="form-group">
                <label class="col-sm-3 control-label">用户ID：</label>
                <div class="col-sm-8">
                    <select id="yh" class="form-control select2-multiple" multiple>
                        <option th:each="yh:${yhs}" th:value="${yh.yhId}" th:text="${yh.uname}"></option>
                    </select>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">社区ID：</label>
                <div class="col-sm-8">
                    <input name="sqId" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">病史ID：</label>
                <div class="col-sm-8">
                    <input name="bsId" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">诊断记录ID：</label>
                <div class="col-sm-8">
                    <input name="zdjlId" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">逻辑位：</label>
                <div class="col-sm-8">
                    <input name="mlogic" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">备注：</label>
                <div class="col-sm-8">
                    <input name="mremarks" class="form-control" type="text">
                </div>
            </div>
        </form>
    </div>
    <th:block th:include="include :: footer" />
    <th:block th:include="include :: select2-js" />
    <script th:inline="javascript">
        var prefix = ctx + "system/bl"
        $("#form-bl-add").validate({
            focusCleanup: true
        });

        function submitHandler() {
            if ($.validate.form()) {
                var data = $("#form-bl-add").serializeArray();
                var yhId = $.form.selectSelects("yh");
                data.push({"name": "yhId", "value": yhId});
                $.operate.save(prefix + "/add", data);
            }
        }
        $(function() {
            $('#post').select2({
                placeholder: "请选择岗位",
                allowClear: true
            });
        })
    </script>
</body>
</html>